package databaseVersionControl.domain.db;

import java.util.ArrayList;
import java.util.List;

public class Table extends DBComponent {

	private List<Column> _columns = new ArrayList<Column>();

	public Table(String name, List<Column> columns) {
		super(name);
		setColumns(columns);
	}

	public List<Column> getColumns() {
		return new ArrayList<Column>(_columns);
	}

	private void setColumns(List<Column> columns) {
		if (columns == null || columns.isEmpty()) throw new IllegalArgumentException("Columns must be defined");
		this._columns = columns;
	}
}